import { defineConfig } from "vite";
import vue from "@vitejs/plugin-vue";
import styleImport, { VantResolve } from "vite-plugin-style-import";
const optimizeCDN = [
    // 有 cdn 加载
    "pinia",
    "vue",
    "chroma-js",
    "pixi.js",
    "@vant/touch-emulator",
    "vue-router",
    "localforage",
    "hammerjs",
];
const optimize = [
    "treeverse",
    "vue-draggable-next",
    "lodash-es",
    "@konghayao/vue-material-icons/src/components/useIcon",

    "vant",
    "pinia-plugin-persist",
    "mitt",
    "@vueuse/core",
    "@vueuse/components",
    "moize",
    "game-algorithm",
];
// https://vitejs.dev/config/
export default defineConfig({
    base: "./",
    // 强制预构建插件包
    optimizeDeps: {
        //检测需要预构建的依赖项
        entries: [],
        //默认情况下，不在 node_modules 中的，链接的包不会预构建
        include: optimize.concat(optimizeCDN),
    },
    plugins: [
        vue(),
        styleImport({
            resolves: [VantResolve()],
        }),
    ],
});
